package io.afu.nginxhelper.utils;

import io.afu.nginxhelper.constant.NgxConst;

import java.util.Map;

public class CommonUtils {

    public static String makeCgiParams(Map<String,String> params,String key) {
        StringBuilder sb= new StringBuilder();
        for (Map.Entry<String,String> entry:params.entrySet()){
            sb.append(key).append(NgxConst.SEP)
                    .append(entry.getKey())
                    .append(NgxConst.SEP)
                    .append(entry.getValue())
                    .append(NgxConst.END_MARK)
                    .append(NgxConst.NEW_LINE);
        }
        return sb.toString();
    }
}
